<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ include file="/WEB-INF/com/com.jsp"%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
   
<title>update</title>
<script type="text/javascript" >
 $(document).ready(function(){
		$(".countId").each(function(){//循环获取所有单位编号 
			var sysCountId = $(this).attr("value");
			var CountId = $("#sysTownSysCountId").attr("value");
			if(sysCountId == CountId){
				$(this).attr("selected","selected");				
		}	
		});
	 });
</script>
    </head>
  
  <body>
   <div class="panel admin-panel">
  <div class="panel-head"><strong><span class="icon-key"></span></strong></div>
  <div class="body-content">
    <form method="post" class="form-x" action="<%=basePath%>/sys/SysTown_update.action">
    <input type="hidden" name="id" value="${sysTown.id}" >
    <div class="form-group">
          <div class="label">
            <label>县：</label>
          </div>
          <div class="field" >
          <select name="sysCountId"  class="input w50">
             <option value="">县分类</option>
				<s:iterator value="countAllList" >
				<option class="countId" value="${countId}" id="${countId}">${countName}</option>
				</s:iterator>
            </select>
            <div class="tips"></div>
          </div>
    </div>
    <div class="form-group">
        <div class="label">
          <label for="sitename">镇编码：</label>
        </div>
        <div class="field">
           <input type="test" class="input w50" id="sysTownId" name="sysTownId" value="${sysTown.sysTownId}" size="50" placeholder="请输入镇编码" data-validate="required:请输入镇编码" />   
        </div>
      </div>  
      <div class="form-group">
        <div class="label">
          <label for="sitename">镇名：</label>
        </div>
        <div class="field">
           <input type="test" class="input w50" id="sysTownName" name="sysTownName" value="${sysTown.sysTownName}" size="50" placeholder="请输入镇名" data-validate="required:请输入镇名" />   
        </div>
      </div>  
      <div class="form-group">
        <div class="label">
          <label></label>
        </div>
        <div class="field">
          <button class="button bg-main icon-check-square-o" type="submit"> 提交</button>   
        </div>
      </div>      
    </form>
  </div>
</div>
 <input name="sysTown.sysCountId" type="hidden" id="sysTownSysCountId" value="${sysTown.sysCountId}"/>  <!-- 用于下拉选择的读取-县 -->
  </body>
</html>
